<?php
/*
Template Name: TOC
*/
get_header('toc'); ?>

<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<?php if ( (function_exists('has_post_thumbnail')) && has_post_thumbnail() ) { 
	the_post_thumbnail('medium', array('class'	=> "cover",
									   'alt'	=> get_the_title(),
									   'title'	=> get_the_title()) );				
}
 $tocid = get_the_ID();
 ?>
<?php endwhile; // end of the loop. ?>

<header class="toc">
	<?php bibliotype_title(); ?><br />
	By <?php bibliotype_author(); ?>
</header>

<div class="body_text">
    
<ul class="toc">	
<?php wp_list_pages(array('title_li' => __('Table of Contents'), 
						  'exclude' => $tocid) ); ?> 
</ul>

<?php 
	get_template_part('nav', 'paging');
	get_footer('toc'); 
?>